import {HTTP} from '../utils/http'

class CourseModel extends HTTP{
  list(current, size){
    return this.request({
      url:'course/selectList',
      data:{
        size: size || 30, 
        current: current || 1,
        cond: JSON.stringify({id: 29})
      },
    })
  }

  index(current, rcmdSize, plainSize){
    return this.request({
      url:'college/index',
      data:{
        rcmdSize: rcmdSize || 0, 
        current: current || 1,
        plainSize: plainSize || 30
      },
    })
  }

  indexClass(id, current, size){
    return this.request({
      url:'course/selectListByType',
      data:{
        cond: JSON.stringify({"id":id}), 
        current: current || 1,
        size: size || 30
      },
    })
  }

  detail(id){
    return this.request({
      url:'course/selectById',
      data:{
        courseId: id
      },
    })
  }
  //课程目录列表
  chapter(id){
    return this.request({
      url:'course/selectPageDetail',
      data:{
        size:99,
        current:1,
        cond: JSON.stringify({'id': id})
      },
    })
  }

  courseDetailSelectById(id){
    return this.request({
      url:'courseDetail/selectById',
      data:{
        id: id
      },
    })
  }
}

export {CourseModel}